<div class="portlet">
  <div class="portlet-header">
    <h1><%=t ".title"%></h1>
  </div>

  <div class="portlet-content">

    <% if @total == 0 %>
      <div class="line-label">
        <%= t('lbl_no_record_found') %>
      </div>
    <% else %>
      <div class="line-label">
        <%=t('lbl_count_record_found') + '<b>' + @total.to_s + '</b>'%>
      </div>
      <div class="line-label">
        <%= will_paginate(@profiles) %>
      </div>

      <table>
        <thead>
          <tr>
            <th><%=t('activerecord.attributes.profile.reference')%></th>
            <th><%=t('activerecord.attributes.profile.excluded')%></th>
            <th colspan="3"><%= t('title_actions') %></th>
          </tr>
        </thead>

        <tbody>
          <% @profiles.each do |profile| %>
            <tr>
              <% if profile.reference.nil? %>
                <td></td>
              <% else %>
                <% if profile.reference_type == 'Thematic' %>
                  <td><%=h profile.reference.name_to_local_language%></td>
                <% end %>
                <% if profile.reference_type == 'Country' %>
                  <td><%=h profile.reference.name%></td>
                <% end %>
              <% end %>
              <td><%=h get_boolean_description(profile.excluded) %></td>

              <td class="action"><%= link_to t('btn_show'), contact_profile_path(profile) %></td>
              <td class="action"><%= link_to t('btn_edit'), edit_contact_profile_path(profile) %></td>
              <td class="action"><%= link_to t('btn_destroy'), {:action => 'destroy', :id => profile}, :confirm => t('msg_sure_destroy?'), :method => :delete %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% end %>

    <div class="line-links">
      <%= link_to t('profiles.index.btn_new_profile'), new_contact_profile_path %>
    </div>
  </div>

  <div class="portlet-footer">
  </div>
</div>